Matthias Clasen [Sun, 28 Jun 2020 16:23:08 +0000 (12:23 -0400)]
gdk: Small documentation fixes
Make sure gdk_event_get_seat shows up.
Matthias Clasen [Sun, 28 Jun 2020 12:06:17 +0000 (08:06 -0400)]
stack: Cosmetic documentation fixes
Fix parameter mismatches.
Matthias Clasen [Sun, 28 Jun 2020 01:53:57 +0000 (21:53 -0400)]
bitset: Cosmetic documentation changes
Matthias Clasen [Sun, 28 Jun 2020 01:46:22 +0000 (21:46 -0400)]
docs: Remove ancient version information
We treat 4.0 as a new era.
Matthias Clasen [Sun, 28 Jun 2020 01:37:28 +0000 (21:37 -0400)]
multiselection: Update docs
Remove information that is no longer true. GtkMultiSelection
is persistent across sorting changes since
3d8b6f6b799499cca02.
Matthias Clasen [Sat, 27 Jun 2020 22:19:27 +0000 (22:19 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2160
Matthias Clasen [Sat, 27 Jun 2020 21:31:22 +0000 (17:31 -0400)]
docs: Migration guide additions
Matthias Clasen [Sat, 27 Jun 2020 21:28:15 +0000 (17:28 -0400)]
builder: Documentation tweaks
Don't use no-longer-existing enums as examples,
and drop the +.
Matthias Clasen [Sat, 27 Jun 2020 19:43:18 +0000 (19:43 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2159
Baurzhan Muftakhidinov [Sat, 27 Jun 2020 19:11:12 +0000 (19:11 +0000)]
Update Kazakh translation
Baurzhan Muftakhidinov [Sat, 27 Jun 2020 18:52:16 +0000 (18:52 +0000)]
Update Kazakh translation
Matthias Clasen [Sat, 27 Jun 2020 13:47:29 +0000 (09:47 -0400)]
gtk-demo: Drop an unused object
The main ui file was still creating a tree store,
but we've switched everything over to use list models.
Matthias Clasen [Sat, 27 Jun 2020 13:36:45 +0000 (09:36 -0400)]
builder: Warn about dropped objects
Use GTK_DEBUG=builder-objects to make GtkBuilder warn
if a named object from a ui files doesn't get claimed
by gtk_builder_get_object(). This is useful for finding
dead wood in .ui files.
Matthias Clasen [Sat, 27 Jun 2020 03:51:21 +0000 (03:51 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
Closes #2897 and #2898
See merge request GNOME/gtk!2158
Matthias Clasen [Sat, 27 Jun 2020 03:07:28 +0000 (23:07 -0400)]
listitem: Correct the docs
Matthias Clasen [Sat, 27 Jun 2020 02:57:56 +0000 (22:57 -0400)]
gtk-demo: Improve formatting in the color demo
Properly align and format the numbers in the size
dropdown.
Matthias Clasen [Sat, 27 Jun 2020 02:22:47 +0000 (22:22 -0400)]
text: Support reverse selection
Take ordering of cursor_position and selection_bound
into account when copying text to the clipboard, and
ensure that both orders work the same.
Fixes: #2898
Matthias Clasen [Sat, 27 Jun 2020 02:13:12 +0000 (22:13 -0400)]
text: Update action enabled state correctly
Take the editable property into account when updating
the emoji.insert action state, and update the action
when it changes.
Fixes: #2897
Matthias Clasen [Sat, 27 Jun 2020 02:12:42 +0000 (22:12 -0400)]
shortcutcontroller: Add some debug spew
This helps in debugging event routing and keyboard
shortcut issues.
Matthias Clasen [Sat, 27 Jun 2020 02:12:14 +0000 (22:12 -0400)]
widget: Fix an oversight
g_message comes with a builtin newline, don't add one
to the message.
Matthias Clasen [Sat, 27 Jun 2020 00:35:51 +0000 (00:35 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Adwaita: Fix block cursors in spinbuttons
Closes #2871
See merge request GNOME/gtk!2156
Matthias Clasen [Fri, 26 Jun 2020 23:55:19 +0000 (19:55 -0400)]
Adwaita: Fix block cursors in spinbuttons
Fix block cursors in vertical spinbuttons with Adwaita.
Fixes: #2871
Matthias Clasen [Fri, 26 Jun 2020 21:14:27 +0000 (21:14 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
Closes #2869
See merge request GNOME/gtk!2155
Matthias Clasen [Fri, 26 Jun 2020 15:56:27 +0000 (11:56 -0400)]
docs: Add css docs to entries
The various entries were missing the semi-standard
"CSS Nodes" section in their long descriptions. Add
them.
Matthias Clasen [Fri, 26 Jun 2020 19:49:39 +0000 (15:49 -0400)]
text: Be more selective when selecting on focus-in
We don't want to select on focus-in when the focus
comes from a child. The case where this does harm
is when you activate copy or paste actions from the
context menu. We close the menu before triggering the
action, and if that causes the text in the entry to
be selected, unexpected things happen, since the action
applies to the current selection.
Fixes: #2869
Matthias Clasen [Fri, 26 Jun 2020 19:27:09 +0000 (15:27 -0400)]
Revert "text: Avoid creating a PangoAttrList we don't need"
This reverts commit
67c26650280ba64ff1c0318be8d848e9563ddb21.
The splicing we do here has the important side-effect
of shifting the preedit attributes to the right position.
Without it, we end up always underlining the first chars
in the entry, regardless where the preedit happens.
Matthias Clasen [Fri, 26 Jun 2020 18:08:35 +0000 (14:08 -0400)]
text: Handle key events in the target phase
This makes sure that we do actual key input right
in the middle between all the capture and bubble
event controllers, and are not dependent on the
ordering of those controllers.
The bug that triggered this change was that the
shortcut for activation (Enter) was getting triggered
before the key input, causing Ctrl-Shift-u hex
to stop working, since it never received the enter
to commit the sequence.
Matthias Clasen [Fri, 26 Jun 2020 18:05:57 +0000 (14:05 -0400)]
widget: Add a debug message for consumed key events
Run the application with GTK_DEBUG=keybindings to
get some hints where key events get lost.
Matthias Clasen [Fri, 26 Jun 2020 18:05:28 +0000 (14:05 -0400)]
text: Give names to event controllers
It helps with debugging.
Matthias Clasen [Fri, 26 Jun 2020 17:08:09 +0000 (17:08 +0000)]
Merge branch 'wip/carlosg/sequence-state-fixups' into 'master'
Fixups to gesture sequence states
Closes #2895
See merge request GNOME/gtk!2154
Carlos Garnacho [Fri, 26 Jun 2020 15:36:37 +0000 (17:36 +0200)]
gtktext: Don't accept (twice!) all press actions
The gesture should claim the sequence after triggering uncancellable
actions, like pasting, showing a menu or selecting words/lines. A
single first button press initiating a drag does not trigger
anything yet, so it should avoid claiming the sequence.
Carlos Garnacho [Fri, 26 Jun 2020 15:35:05 +0000 (17:35 +0200)]
gtkswitch: Don't be eager in accepting the gesture
The gesture should be accepted whenever it triggers uncancellable
actions in the widget. This means it should be accepted if the
click does result in toggling the switch.
This leaves the pan gesture room to handle dragging the handle.
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2895
Matthias Clasen [Fri, 26 Jun 2020 14:31:20 +0000 (14:31 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
main: Avoid a warning
Closes #2894
See merge request GNOME/gtk!2153
Matthias Clasen [Fri, 26 Jun 2020 13:05:56 +0000 (09:05 -0400)]
docs: Some tweaks to the list widget overview
Matthias Clasen [Fri, 26 Jun 2020 12:43:49 +0000 (12:43 +0000)]
Merge branch 'wip/otte/bitset' into 'master'
Improve selection handling API for rubberbanding
See merge request GNOME/gtk!2086
Matthias Clasen [Fri, 26 Jun 2020 12:19:32 +0000 (08:19 -0400)]
main: Avoid a warning
transient-for relationships only exist between
windows, so check that both candidates are such.
Fixes: #2894
Emmanuele Bassi [Fri, 26 Jun 2020 08:48:51 +0000 (08:48 +0000)]
Merge branch 'tintou/dropdown-annotations' into 'master'
dropdown: Annotate the get_selected_item method
See merge request GNOME/gtk!2152
Emmanuele Bassi [Fri, 26 Jun 2020 08:46:35 +0000 (08:46 +0000)]
Merge branch 'wip/ricotz/annotations' into 'master'
gtk: Add some g-i annotations to GtkStringList
See merge request GNOME/gtk!2150
Corentin Noël [Fri, 26 Jun 2020 07:59:12 +0000 (09:59 +0200)]
dropdown: Annotate the get_selected_item method
We need to specify the type as we already know that it is at least a GObject and in case of no selection, NULL is returned.
Benjamin Otte [Fri, 26 Jun 2020 02:07:35 +0000 (04:07 +0200)]
listbase: Make rubberbanding a threshold drag
Benjamin Otte [Fri, 26 Jun 2020 01:26:11 +0000 (03:26 +0200)]
listbase: Only compute the modifiers when releasing the rubberband
... and do the right things:
nothing: selection = rubberband
ctrl: selection = selection OR rubberband
shift: selection = selection AND (NOT rubberband)
ctrl+shift: selection = selection XOR rubberband
(not sure this one makes sense, but toggling is fun)
Benjamin Otte [Fri, 26 Jun 2020 00:56:38 +0000 (02:56 +0200)]
listbase: Compute rubberband region on-demand
Instead of storing the active items as we go, compute the affected items
whenever the rubberband changes and in particular when the rubberband
ends.
That way, the rubberband is guaranteed to select a rectangle even
after scrolling very far.
This is achieved by having a get_items_in_rect() vfunc that selects all
the items in the rubberbanded rectangle and returns them as a bitset.
Benjamin Otte [Fri, 26 Jun 2020 00:55:53 +0000 (02:55 +0200)]
listview: Allocate rubberband at end of size_allocate()
Otherwise the rubberband uses the wrong scroll offsets.
Benjamin Otte [Wed, 24 Jun 2020 03:52:35 +0000 (05:52 +0200)]
listbase: Flip autoscroll deltas if adjustments are flipped
Fixes autoscroll on RTL languages.
Benjamin Otte [Wed, 24 Jun 2020 03:42:38 +0000 (05:42 +0200)]
listbase: Allocate gridview items properly on RTL
We need to flip the items.
Benjamin Otte [Wed, 24 Jun 2020 03:25:28 +0000 (05:25 +0200)]
multiselection: Implement get_selection_in_range()
Benjamin Otte [Wed, 24 Jun 2020 03:02:04 +0000 (05:02 +0200)]
listbase: Allocate rubberband according to list coords
The rubberband is now handled on the list coordinate system.
When starting the rubberband, we track the item under the pointer and
follow it when it is moving.
This may lead to the rubberband start position changing position and
while this may be confusing, it alerts users to the fact that something
crazy is going on.
Benjamin Otte [Wed, 24 Jun 2020 02:49:21 +0000 (04:49 +0200)]
listbase: Move a common function from the children into GtkListBase
We want to use it for the rubberband later.
Benjamin Otte [Wed, 24 Jun 2020 02:46:53 +0000 (04:46 +0200)]
listbase: Don't do extra work
Scrolling causes a queue_resize() which will update the rubberband in
size_allocate() and queue a draw.
Benjamin Otte [Sun, 21 Jun 2020 21:01:36 +0000 (23:01 +0200)]
Fix indentation
Benjamin Otte [Sun, 21 Jun 2020 16:03:25 +0000 (18:03 +0200)]
gtk: Remove GtkPropertySelection
GtkMultiSelection is so much faster than this that it isn't needed.
Benjamin Otte [Sun, 21 Jun 2020 16:00:11 +0000 (18:00 +0200)]
gtk-demo: Port listview-colors demo to multiselection again
Benjamin Otte [Sun, 21 Jun 2020 15:58:27 +0000 (17:58 +0200)]
multiselection: Track items across resorts
In particular, track which items remain in ::items-changed
signal emissions.
But the main use case is sorting, which causes items-changed(0, n, n)
to be emitted.
Benjamin Otte [Sun, 14 Jun 2020 05:08:44 +0000 (07:08 +0200)]
Remove GtkSet
It's been superceded by GtkBitset.
Benjamin Otte [Sun, 14 Jun 2020 05:07:30 +0000 (07:07 +0200)]
selectionmodel: Remove select_callback() functions
gtk_selection_model_set_selection() takes care of those now.
Benjamin Otte [Sun, 14 Jun 2020 04:50:22 +0000 (06:50 +0200)]
listbase: Port rubberband to gtk_selection_model_set_selection()
Benjamin Otte [Sun, 14 Jun 2020 04:41:05 +0000 (06:41 +0200)]
selectionmodel: Add gtk_selection_model_set_selection()
Also port the testsuite.
Benjamin Otte [Sun, 14 Jun 2020 03:30:06 +0000 (05:30 +0200)]
selectionmodel: Replace query_range() with get_selection()
Benjamin Otte [Sat, 13 Jun 2020 03:27:34 +0000 (05:27 +0200)]
multiselection: Port to GtkBitset
Benjamin Otte [Sat, 13 Jun 2020 03:05:30 +0000 (05:05 +0200)]
testsuite: Add tests for GtkBitset
Benjamin Otte [Wed, 10 Jun 2020 06:14:02 +0000 (08:14 +0200)]
Add GtkBitset
Rico Tzschichholz [Thu, 25 Jun 2020 21:10:37 +0000 (23:10 +0200)]
gtk: Add some g-i annotations to GtkStringList
Benjamin Otte [Wed, 10 Jun 2020 05:39:25 +0000 (07:39 +0200)]
Add amalgamated roaring bitmaps source code
Taken from https://github.com/RoaringBitmap/CRoaring and fixed to
not spew warnings.
Matthias Clasen [Thu, 25 Jun 2020 22:28:07 +0000 (22:28 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2149
Matthias Clasen [Thu, 25 Jun 2020 20:40:54 +0000 (16:40 -0400)]
inspector: Adapt to dropdown api change
The suppported syntax for dropdowns in ui files
has changed. Get with the program.
Matthias Clasen [Thu, 25 Jun 2020 18:29:24 +0000 (14:29 -0400)]
docs: Fix a typo
Matthias Clasen [Thu, 25 Jun 2020 18:28:29 +0000 (14:28 -0400)]
gtk-demo: Fix a typo in the listbox demo
Matthias Clasen [Thu, 25 Jun 2020 18:14:33 +0000 (14:14 -0400)]
searchentry: Update the docs slightly
Update the docs to get closer to describing reality.
Matthias Clasen [Thu, 25 Jun 2020 12:03:10 +0000 (08:03 -0400)]
Drop unused includes
Don't include gtkfilechooserentry.h where it
isn't used.
Matthias Clasen [Thu, 25 Jun 2020 02:08:09 +0000 (22:08 -0400)]
stringfilter: Fix a typo
Emin Tufan Çetin [Thu, 25 Jun 2020 01:05:12 +0000 (01:05 +0000)]
Update Turkish translation
Matthias Clasen [Wed, 24 Jun 2020 21:32:30 +0000 (21:32 +0000)]
Merge branch 'wip/carlosg/input-cleanups' into 'master'
Some input cleanups
Closes #2851
See merge request GNOME/gtk!2147
Matthias Clasen [Wed, 24 Jun 2020 19:58:03 +0000 (19:58 +0000)]
Merge branch 'scrolled-window-api' into 'master'
scrolledwindow: Don't take adjustments in new()
See merge request GNOME/gtk!2146
Matthias Clasen [Wed, 24 Jun 2020 19:50:37 +0000 (19:50 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2145
Carlos Garnacho [Wed, 24 Jun 2020 18:19:03 +0000 (20:19 +0200)]
gtktextview: Remove child textview items last
The function tries to go through every child, so it's convenient
to remove all internal ones first.
Carlos Garnacho [Wed, 24 Jun 2020 15:31:03 +0000 (17:31 +0200)]
gtkwidget: Drop _gtk_widget_[gs]et_shadowed()
This API is meaningless now, with grab-notify being handled internally.
Carlos Garnacho [Wed, 24 Jun 2020 16:24:12 +0000 (18:24 +0200)]
gtkwidget: Avoid use of shadowed flag
This is going away, look up whether there is a grab, and whether
the widget is within it, instead.
Carlos Garnacho [Wed, 24 Jun 2020 15:25:34 +0000 (17:25 +0200)]
gtkwidget: Drop gtk_widget_device_is_shadowed()
A widget no longer needs updating on GTK grabs on itself, drop
this miscellaneous and no longer used API.
Carlos Garnacho [Wed, 24 Jun 2020 15:23:11 +0000 (17:23 +0200)]
gtkwidget: Drop internal checks in grab-notify
There's no need to check if the widget is already shadowed, we
implicitly have that from the signal argument.
Carlos Garnacho [Wed, 24 Jun 2020 15:19:57 +0000 (17:19 +0200)]
gtkmain: Make grab-notify notifications more targeted
We only want to send grab-notify to widgets that might have been
interacting with devices via events. Instead of going through all
widgets in all toplevels, we have the window/pointer focus information,
so we can just traverse the widget stacks for every involved foci.
Carlos Garnacho [Wed, 24 Jun 2020 13:40:05 +0000 (15:40 +0200)]
gtkwidget: Drop ::grab-notify signal and vfunc
We don't expect widgets to react directly to these anymore.
Internally we still reset the controllers.
Carlos Garnacho [Wed, 24 Jun 2020 13:37:11 +0000 (15:37 +0200)]
gtkprintoperation-win32: Don't track grab-notify
Further grabs could presumably only come from events handled within
the dialog itself. It seems overeager to do this.
Carlos Garnacho [Wed, 24 Jun 2020 13:35:16 +0000 (15:35 +0200)]
gtkvideo: Track child focus to determine whether controls should autohide
Move away from grab_notify, and use the set_child_focus() vfunc to track
child widgets being set the keyboard focus. This is not 1:1, but seems
good enough at the moment.
Carlos Garnacho [Wed, 24 Jun 2020 12:17:15 +0000 (14:17 +0200)]
gtkbutton: Drop grab_notify handler
The click gesture already has a ::cancel handler, and does almost
everything it should. Move the last bits and remove the grab_notify
handler.
Carlos Garnacho [Wed, 24 Jun 2020 12:12:01 +0000 (14:12 +0200)]
gtkspinbutton: Drop grab_notify handler
The press gesture on the buttons already has a ::cancel handler,
this is redundant.
Carlos Garnacho [Wed, 24 Jun 2020 12:10:42 +0000 (14:10 +0200)]
gtknotebook: Move away from grab_notify
Connect to ::cancel on the relevant gesture instead.
Matthias Clasen [Wed, 24 Jun 2020 18:06:50 +0000 (14:06 -0400)]
testgtk: Update list of cursor names
Use the standard names, since that is what we want
everybody else to use too.
Matthias Clasen [Wed, 24 Jun 2020 17:01:34 +0000 (13:01 -0400)]
Install gtkstringlist.h
Matthias Clasen [Wed, 24 Jun 2020 04:26:27 +0000 (00:26 -0400)]
entrycompletion: Various fixes
Fix various issues that prevented inline completion
and inline selection from working reliably. We were
passing byte counts to gtk_editable_select_region in
one place, but that function expects char counts.
We were listening for GtkEditable::insert-text on
the GtkText widget, but that does not emit those signals,
so listen for GtkEntryBuffer::inserted-text instead.
Finally, we were not clearing the stored completion_prefix
enough, leading to situations where the stored prefix
does not match the text in the entry anymore.
Matthias Clasen [Wed, 24 Jun 2020 04:27:21 +0000 (00:27 -0400)]
gtk-demo: Enable inline completion
Enable inline completion in the entry completion
demo, to have some code exercising this feature.
It is broken.
Matthias Clasen [Wed, 24 Jun 2020 02:39:16 +0000 (22:39 -0400)]
gtk-demo: Improve the entry completion demo
Add more strings.
Matthias Clasen [Wed, 24 Jun 2020 15:25:09 +0000 (11:25 -0400)]
scrolledwindow: Don't take adjustments in new()
In 99.9% of all cases, these are just NULL, NULL.
So just do away with these arguments, people can
use the setters for the rare cases where they want
the scrolled window to use a different adjustment.
Carlos Garnacho [Wed, 24 Jun 2020 11:41:28 +0000 (13:41 +0200)]
gtkwindowhandle: Drop has-grab checks
While it's worth thinking about bringing the "windows can be dragged
with open popovers" behavior back, this does not kick in anymore, nor
should be the way to handle this given all the autoclose surface
semantic changes.
Carlos Garnacho [Wed, 24 Jun 2020 09:20:15 +0000 (11:20 +0200)]
gdk: Drop gdk_device_get_last_event_surface()
This kind of transient state sets the expectative that events update
devices, while it's more accurate to say that devices generate events.
It does not make to expose this function anymore.
Carlos Garnacho [Wed, 24 Jun 2020 09:14:52 +0000 (11:14 +0200)]
gtkwidget: Avoid poking surfaces and events in gtk_widget_list_devices()
This got stuck in ancient times when widgets were windowed, so the devices
in a window to know the devices in that widget would pan out. We do only
want here the devices that are inside the widget, not spread over the
surface, so rewrite this helper function to poke the toplevel foci, and
look they are contained inside the widget.
Carlos Garnacho [Tue, 23 Jun 2020 10:19:20 +0000 (12:19 +0200)]
gtkwidget: Drop _gtk_widget_get_device_surface()
A widget cannot have multiple surfaces anymore, nor needs to
fetch the last event surface as it ought to handle its own.
Carlos Garnacho [Tue, 23 Jun 2020 10:15:00 +0000 (12:15 +0200)]
gtkmain: Drop unused struct field
Grabs are, ironically, not about devices anymore. This struct field
is never set.
Carlos Garnacho [Tue, 23 Jun 2020 09:15:04 +0000 (11:15 +0200)]
gtkwidget: Remove dead code
This variable got unused over time.
Carlos Garnacho [Tue, 23 Jun 2020 09:00:46 +0000 (11:00 +0200)]
gdk: Depend less on gdk_event_get_device()
For the most part, we are interested in seats here.
Carlos Garnacho [Mon, 22 Jun 2020 23:14:53 +0000 (01:14 +0200)]
gdk: Add gdk_event_get_seat()
It currently fetches the seat from the event device, will be changed
in future commits.